home *** CD-ROM | disk | FTP | other *** search
/ The Netherlands - A Compact World / The Netherlands.iso / chapters / 4.1.5.dxr / Internal_2_V2 tekstimport met MAC, MacChars, Edit, Tekstkleur.ls < prev    next >
Encoding:
Text File  |  2004-06-10  |  1.4 KB  |  43 lines

  1. property spriteNum
  2. global taalkeuze, maclist, tekstkleur
  3.  
  4. on vertalen me
  5.   sprite(spriteNum).visibility = 0
  6.   if tekstkleur = VOID then
  7.     sprite(spriteNum).member.foreColor = 235
  8.   else
  9.     sprite(spriteNum).member.foreColor = tekstkleur
  10.   end if
  11.   if taalkeuze = VOID then
  12.     taalkeuze = "nl"
  13.   end if
  14.   tekstpad = "@txt:" & taalkeuze & ":"
  15.   fieldnaam = sprite(spriteNum).member.name
  16.   bestandnaam = fieldnaam & ".txt"
  17.   buffer = new(xtra("fileio"))
  18.   openFile(buffer, tekstpad & bestandnaam, 1)
  19.   setPosition(buffer, 0)
  20.   bufferinhoud = readFile(buffer)
  21.   closeFile(buffer)
  22.   tellertje = 1
  23.   repeat while line tellertje of bufferinhoud > EMPTY
  24.     repeat with Tellertje8 = 1 to (line tellertje of bufferinhoud).length
  25.       if char Tellertje8 of line tellertje of bufferinhoud = numToChar(10) then
  26.         put EMPTY into char Tellertje8 of line tellertje of bufferinhoud
  27.       end if
  28.       if (char Tellertje8 of line tellertje of bufferinhoud).charToNum > 127 then
  29.         if the platform contains "Mac" then
  30.           put numToChar(maclist[(char Tellertje8 of line tellertje of bufferinhoud).charToNum - 127]) into char Tellertje8 of line tellertje of bufferinhoud
  31.         end if
  32.       end if
  33.     end repeat
  34.     tellertje = tellertje + 1
  35.   end repeat
  36.   put bufferinhoud into member fieldnaam
  37.   sprite(spriteNum).visibility = 1
  38. end
  39.  
  40. on beginSprite me
  41.   sendSprite(spriteNum, #vertalen)
  42. end
  43.